/*
* File: 		ring_queue.h
* Author: 		Akira
* Date: 		2023-11-16
* Description:  循环队列的链式存储实现
* Version: 		1.0.0
* Modify: 		None.
*/

#ifndef __RING_QUEUE_H__
#define __RING_QUEUE_H__

#include <stdlib.h>
#include <stdbool.h>
#include <malloc.h>

//循环队列的链式存储实现

typedef int ElemType;
typedef struct LinkNode {
	ElemType data;
	struct LinkNode* next;
} LinkNode;

typedef struct {
	LinkNode* rear;
	int length;
} LinkRingQueue;

extern void InitRingQueue(LinkRingQueue* rq);
extern bool RingQueueEmpty(LinkRingQueue* rq);
extern bool EnRingQueue(LinkRingQueue* rq, ElemType x);
extern bool DeRingQueue(LinkRingQueue* rq, ElemType* x);
extern int LengthRingQueue(LinkRingQueue* rq);
extern bool GetRingLead(LinkRingQueue* rq, ElemType* x);

#endif /* __RING_QUEUE_H__ */
